import { BroadCastCall } from "../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../Framework/MQ/MessageBlock";
import { SSeqAttributeUpdate } from "../../../../Message/Public/SSeqAttributeUpdate";
import { RolePlayer } from "../../scene/player/entity/RolePlayer";
import { SAttributeUpdate } from "../../../../Message/Public/SAttributeUpdate";
import { EEntityAttribute } from "../../../../Message/Public/EEntityAttribute";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { Language } from "../../../../extend/language/Language";
import { MsgManager } from "../../manager/MsgManager";
import { LevelGuideConfig } from "../../resource/LevelGuideConfig";
import { NetDispatcher } from "../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../mvc/ServerCommand";
import { ResManager } from "../../../common/ResManager";
import { Global } from "../../../../com/gengine/global/Global";
import { Cache } from "../../cache/Cache";
import { AttributeValue } from "../../scene/player/AttributeValue";
import { AttributeTextType } from "../../scene/player/type/AttributeTextType";
import { UpdateCode } from "../../../component/gconst/UpdateCode";
import { ExpAddInfo } from "../../view/effect/ExpAddInfo";
import { EEntityFightMode } from "../../../../Message/Public/EEntityFightMode";
import { EEquip } from "../../../../Message/Public/EEquip";
import { _code } from "../../../../this/_code";
type int = number;
//class AttributeUpdateCommand
    
    export  class AttributeUpdateCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc2=null;
            var loc1=arg1.messageBase as SSeqAttributeUpdate;
            this._code = loc1.code;
            var loc3=0;
            var loc4=loc1.updates;
            for(loc2 of loc4) 
            {
                this.playerInfoUpdate(loc2);
                this.weaponUpdate(loc2);
                this.fightAttUpdate(loc2);
                this.copyProcessUpdate(loc2);
            }
            if (RolePlayer.instance.isInitInfo) 
            {
                RolePlayer.instance.updateEntityAttribute(loc1.updates);
            }
            return;
        }

        /* internal  */playerInfoUpdate(arg1: SAttributeUpdate): void
        {
            var loc1=0;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=null;
            var loc7=0;
            var loc8=0;
            var loc9=0;
            var loc10=null;
            var loc11=0;
            var loc12=null;
            var loc13=false;
            var loc14=0;
            var loc15=false;
            var loc16=arg1.attribute.__value;
            switch (loc16) 
            {
                case EEntityAttribute._EAttributeGateChannelId:
                {
                    break;
                }
                case EEntityAttribute._EAttributeServerId:
                {
                    break;
                }
                case EEntityAttribute._EAttributeCellId:
                {
                    break;
                }
                case EEntityAttribute._EAttributePlayerId:
                {
                    break;
                }
                case EEntityAttribute._EAttributeUsername:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSex:
                {
                    _cache.role.entityInfo.sex = arg1.value;
                    _cache.role.playerInfo.sex = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SexAttributeSexChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeType:
                {
                    break;
                }
                case EEntityAttribute._EAttributeCode:
                {
                    break;
                }
                case EEntityAttribute._EAttributeName:
                {
                    _cache.role.entityInfo.name = arg1.valueStr;
                    this._isEntityInfoUpdate = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerNameChange, arg1.valueStr));
                    break;
                }
                case EEntityAttribute._EAttributeTitles:
                {
                    break;
                }
                case EEntityAttribute._EAttributeCamp:
                {
                    _cache.role.entityInfo.camp = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeAvatar:
                {
                    _cache.role.avatar = arg1.value;
                    _cache.role.entityInfo.avatarId = arg1.value;
                    this._isEntityInfoUpdate = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChangeRoleAvatarHeadIcon));
                    break;
                }
                case EEntityAttribute._EAttributeGrowth:
                {
                    break;
                }
                case EEntityAttribute._EAttributeRoleId:
                {
                    break;
                }
                case EEntityAttribute._EAttributeLevel:
                {
                    loc1 = arg1.value - _cache.role.entityInfo.level;
                    _cache.role.entityInfo.level = arg1.value;
                    _cache.role.roleInfo.level = arg1.value;
                    if (loc1 >= 1) 
                    {
                        loc2 = Language.getStringByParam(35900, arg1.value);
                        MsgManager.addTipText(loc2);
                        MsgManager.showRollTipsMsg(loc2);
                        loc3 = "";
                        if ((loc4 = LevelGuideConfig.instance.getLevelGuideInfoByLevel(arg1.value)) != null) 
                        {
                            loc3 = loc4.guide;
                        }
                        if (loc3 != "") 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.MsgTipDateChange, loc3));
                        }
                    }
                    NetDispatcher.dispatchCmd(ServerCommand.RoleLevelUpdate, arg1.value);
                    ResManager.instance.loadLevelRes();
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributeCareer:
                {
                    _cache.role.roleInfo.career = arg1.value;
                    _cache.role.entityInfo.career = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleCareerUpdate, _cache.role.roleInfo.career);
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributeCareerSecond:
                {
                    _cache.role.roleInfo.careerSecond = arg1.value;
                    _cache.pack.rolePackCache.updateSecondCareerItems();
                    _cache.pack.runePackCache.updateSecondCareerItems();
                    NetDispatcher.dispatchCmd(ServerCommand.RoleCareerSecondUpdate, _cache.role.roleInfo.careerSecond);
                    break;
                }
                case EEntityAttribute._EAttributeCareerEnable:
                {
                    if (_cache.role.roleInfo || Global.isDebugModle) 
                    {
                        _cache.role.roleInfo.careerEnable = arg1.value;
                        _cache.role.entityInfo.careerEnable = arg1.value;
                        NetDispatcher.dispatchCmd(ServerCommand.RoleCareerEnableUpdate, _cache.role.roleInfo.careerEnable);
                        this._isEntityInfoUpdate = true;
                    }
                    break;
                }
                case EEntityAttribute._EAttributeExperience:
                {
                    _cache.role.roleInfo.experience = parseFloat(arg1.valueStr);
                    NetDispatcher.dispatchCmd(ServerCommand.RoleExpUpdate, _cache.role.roleInfo);
                    break;
                }
                case EEntityAttribute._EAttributeExperienceAdd:
                {
                    loc5 = Cache.instance.role.levelSealInfo;
                    if (RolePlayer.instance.isRest || RolePlayer.instance.isDoubleRest || arg1.value >= 100000 || RolePlayer.instance.isSunBath) 
                    {
                        RolePlayer.instance.showAttributChange(new AttributeValue(AttributeTextType.experience, true, arg1.value));
                    }
                    if (this._code != UpdateCode.EUpdateCodeMergeCopy) 
                    {
                        loc6 = Language.getStringByParam(35903, arg1.value);
                    }
                    else 
                    {
                        loc6 = Language.getStringByParam(35907, arg1.value);
                    }
                    MsgManager.addTipText(loc6);
                    if ((loc7 = Cache.instance.role.levelSealExpAddPercent) > 0 && !(this._code == UpdateCode.EUpdateCodeCallBackExpGiving)) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(30254, Math.floor(arg1.value * loc7 / 100)));
                    }
                    if ((loc8 = Cache.instance.recallOldPlayers.oldPlayersExpAddPercent) > 0 && !(this._code == UpdateCode.EUpdateCodeCallBackExpGiving)) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(27743, Math.floor(arg1.value * loc8 / 100)));
                    }
                    if (_cache.role.getWorldExAble() == true && !(this._code == UpdateCode.EUpdateCodeBagUseSuperExp) && !(this._code == UpdateCode.EUpdateCodeCallBackExpGiving)) 
                    {
                        loc10 = Language.getStringByParam(35908, Math.floor(arg1.value * _cache.role.exPerent));
                        MsgManager.addTipText(loc10);
                    }
                    if ((loc9 = _cache.role.holidayRetExpPercent) > 0 && !(this._code == UpdateCode.EUpdateCodeCallBackExpGiving)) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(35909, Math.floor(arg1.value * loc9 / 100)));
                    }
                    if (this._code == UpdateCode.EUpdateCodeGuildFlame) 
                    {
                        NetDispatcher.dispatchCmd(ServerCommand.GuildFlameExpAddCommand, arg1.value);
                    }
                    if (this._code == UpdateCode.EUpdateCodeGuildStruggle) 
                    {
                        _cache.copy.guildCopyExp = _cache.copy.guildCopyExp + arg1.value;
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GuildCopyUpdateExp, arg1.value));
                    }
                    NetDispatcher.dispatchCmd(ServerCommand.RoleExpAdd, new ExpAddInfo(arg1.value, this._code));
                    break;
                }
                case EEntityAttribute._EAttributeNimbus:
                {
                    if ((loc11 = arg1.value - _cache.role.roleInfo.nimbus) > 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(35904, loc11));
                        if (RolePlayer.instance.isRest || RolePlayer.instance.isDoubleRest || RolePlayer.instance.isSunBath) 
                        {
                            RolePlayer.instance.showAttributChange(new AttributeValue(AttributeTextType.Nimbus, true, loc11));
                        }
                        if (this._code == UpdateCode.EUpdateCodeGuildPartyFood || this._code == UpdateCode.EUpdateCodeGuildParty) 
                        {
                            NetDispatcher.dispatchCmd(ServerCommand.GuildPartyAuraAddCommand, {"updateCode": _code, "aura": loc11});
                        }
                        if (this._code == UpdateCode.EUpdateCodeGuildFlame) 
                        {
                            NetDispatcher.dispatchCmd(ServerCommand.GuildFlameNimbusAddCommand, loc11);
                        }
                    }
                    else if (loc11 < 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(35905, Math.abs(loc11)));
                    }
                    _cache.role.roleInfo.nimbus = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleNimbusChange, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeExperienceDel:
                {
                    loc12 = Language.getStringByParam(35906, arg1.value);
                    MsgManager.addTipText(loc12);
                    break;
                }
                case EEntityAttribute._EAttributeFightMode:
                {
                    _cache.role.entityInfo.fightModel = arg1.value;
                    if (arg1.value != 1) 
                    {
                        if (arg1.value == 0) 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.FightSetModeSuccess, EEntityFightMode.convert(EEntityFightMode._EEntityFightModePeace)));
                        }
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FightSetModeSuccess, EEntityFightMode.convert(EEntityFightMode._EEntityFightModeFight)));
                    }
                    break;
                }
                case EEntityAttribute._EAttributeGroupStatus:
                {
                    _cache.role.entityInfo.groupStatus = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeCrossGroupStatus:
                {
                    _cache.role.entityInfo.crossGroupStatus = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeCopySuccess:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.Copy_Success, null);
                    break;
                }
                case EEntityAttribute._EAttributeCopyFail:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.Copy_Fail, null);
                    break;
                }
                case EEntityAttribute._EAttributeGrowthPower:
                {
                    _cache.role.roleInfo.growthPower = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerGrowthUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeGrowthAgile:
                {
                    _cache.role.roleInfo.growthAgile = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerGrowthUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeGrowthHabitus:
                {
                    _cache.role.roleInfo.growthHabitus = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerGrowthUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeGrowthBrains:
                {
                    _cache.role.roleInfo.growthBrains = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerGrowthUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeGrowthSpiritual:
                {
                    _cache.role.roleInfo.growthSpiritual = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerGrowthUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeRecharge:
                {
                    _cache.role.recharge = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.HavePay, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeMergeRecharge:
                {
                    _cache.role.mergeRecharge = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MergeRechargeValue, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeEnergy:
                {
                    _cache.role.roleInfo.energy = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleEnergyUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeStatus:
                {
                    _cache.role.entityInfo.status = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.PlayerAttributeStatusUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeVIPType:
                {
                    _cache.role.entityInfo.VIP = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeGuild:
                {
                    _cache.role.entityInfo.guildId = arg1.value;
                    _cache.role.entityInfo.guildName = arg1.valueStr;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerGuildNameChange, arg1.valueStr));
                    break;
                }
                case EEntityAttribute._EAttributeGuildLevel:
                {
                    _cache.role.entityInfo.guildLevel = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeGuildPosition:
                {
                    _cache.role.entityInfo.guildPosition = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeAction:
                {
                    _cache.role.entityInfo.action = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeFavoriteGame:
                {
                    loc13 = arg1.value != 1 ? false : true;
                    _cache.role.isAddedFavorite = loc13;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FavoriteUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeExperienceDelay:
                {
                    _cache.copy.defendCopyExp = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.Copy_DefendCopyAddExp, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeExperienceAddDelay:
                {
                    break;
                }
                case EEntityAttribute._EAttributeWeaponStrengthenPrefectLevel:
                {
                    RolePlayer.instance.reserveJs.weaponStPerLv = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeMountStrengthenLevel:
                {
                    RolePlayer.instance.reserveJs.mountStrLv = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeWingStrengthenPrefectLevel:
                {
                    RolePlayer.instance.reserveJs.wingStrPerLv = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeSex:
                {
                    _cache.role.entityInfo.sex = arg1.value;
                    RolePlayer.instance.entityInfo.entityInfo.sex = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeAccumulation:
                {
                    if ((loc14 = arg1.value - _cache.role.accumulation) > 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(36015, loc14));
                    }
                    else if (loc14 < 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(36016, Math.abs(loc14)));
                    }
                    _cache.role.accumulation = arg1.value;
                    this._isEntityInfoUpdate = true;
                    NetDispatcher.dispatchCmd(ServerCommand.SuitSkillAccCommand, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeCharm:
                {
                    _cache.role.charm = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.RoleAttributeCharmChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeOneKeyMakeFriends:
                {
                    _cache.friendBless.onekeyFriendCount = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OneKeyFriends_TimeChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeForceUpdate:
                {
                    RolePlayer.instance.entityInfo.entityInfo.force = arg1.value;
                    _cache.role.entityInfo.force = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeGuildReiki:
                {
                    _cache.guild.guildTreeAura = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildTreeAuraUpdate, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeGuildTreeRipeTime:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildTreeLeftTimeUpdate, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeGuildSkillLearnTimes:
                {
                    Cache.instance.guild.skillStudyTime = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildSkillStudyTimeUpdate, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNewEnergyAdd:
                {
                    if (arg1.value > 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(36024, arg1.value));
                    }
                    else if (arg1.value < 0) 
                    {
                        MsgManager.addTipText(Language.getStringByParam(36025, -arg1.value));
                    }
                    break;
                }
                case EEntityAttribute._EAttributeNewEnergy:
                {
                    _cache.role.roleInfo.newEnergy = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleNewEnergyUpdate, null);
                    break;
                }
                case EEntityAttribute._EAttributeNewEnergyMax:
                {
                    _cache.role.roleInfo.newEnergyMax = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleNewEnergyUpdate, null);
                    break;
                }
                case EEntityAttribute._EAttributeMedal:
                {
                    _cache.role.medalCode = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleMedalUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeNotShowTitle:
                {
                    _cache.title.isNotShowTitle = Boolean(arg1.value);
                    NetDispatcher.dispatchCmd(ServerCommand.TitleNotShowTitle, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeShowCountryTitle:
                {
                    _cache.title.isShowWorldPost = Boolean(arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeNotShowPetTitle:
                {
                    _cache.petTitle.isNotShowTitle = Boolean(arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeFightSpiritLevel:
                {
                    loc15 = false;
                    if (arg1.value == _cache.role.fightSpiritLevel) 
                    {
                        loc15 = false;
                    }
                    else 
                    {
                        loc15 = true;
                    }
                    _cache.role.fightSpiritLevel = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritLevelChange, loc15));
                    break;
                }
                case EEntityAttribute._EAttributeFightSpiritExp:
                {
                    _cache.role.fightSpiritExp = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritExpChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeTodayCulFightSpiritTimes:
                {
                    _cache.role.fightSpiritTime = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritLeftTimeChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeFightSpiritExtraDays:
                {
                    _cache.role.fightSpiritExtraDays = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritGoUpdateTimesChange));
                    break;
                }
                case EEntityAttribute._EAttributeFightSpiritFrontTaskFlag:
                {
                    _cache.role.fightSpiritOpenFlag = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritOpenFlagChange));
                    break;
                }
                case EEntityAttribute._EAttributeFightSpiritBreakLevel:
                {
                    _cache.role.fightSpiritBreakLv = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSpiritChangePanelUpdateView));
                    break;
                }
                case EEntityAttribute._EAttributeSendCardTimes:
                {
                    _cache.role.sendCardTimes = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChristmasCardSendTimes));
                    break;
                }
                case EEntityAttribute._EAttributeMountStarsSpiritFlag:
                {
                    _cache.pack.mountsPackCache.mountStarsCultureFlag = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributePlantFlowerBlessTimes:
                {
                    _cache.plantFlower.hasBlessTimes = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlantFlower_UpdateFlowerBless));
                    break;
                }
                case EEntityAttribute._EAttributeCrossSpy:
                {
                    _cache.crossTask.lastFinishTaskCode = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CrossTaskLastFinishTaskCodeUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionModelSuit:
                {
                    _cache.role.fashionModelSuit = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeRobFlagHonour:
                {
                    _cache.role.money.robFlagHonour = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.RobFlagContributionUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeActiveSpiritEquip:
                {
                    _cache.role.activeSpiritEquip = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.ActiveSpiritEquipUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeDragonSpiritEquipEndFlag:
                {
                    _cache.role.spiritEquipEndFlag[0] = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.SpiritEquipEndFlagUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeTigerSpiritEquipEndFlag:
                {
                    _cache.role.spiritEquipEndFlag[1] = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.SpiritEquipEndFlagUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeSuzakuSpiritEquipEndFlag:
                {
                    _cache.role.spiritEquipEndFlag[2] = arg1.value;
                    _cache.role.spiritEquipEndFlag[3] = arg1.value;
                    _cache.role.spiritEquipEndFlag[4] = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.SpiritEquipEndFlagUpdate, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeWuxingDiceOneKeyTimes:
                {
                    _cache.wuxing.wuxingDiceOneKeyUseTimes = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.ActiveWuxingDiceOneKeyTimes, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeRuneFeedOneKeyTimes:
                {
                    _cache.skill.activeUseTime = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.ActiveRuneFeedOneKeyTimes, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeWuxingSpritOneKeyTimes:
                {
                    _cache.wuxing.wuxingSpiritUseTimes = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.ActiveWuxingSpiritOneKeyTimes, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeMountAdvanceOneKeyTimes:
                {
                    _cache.pack.mountsPackCache.mountUpgradeActiveUseTimes = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.ActiveMountAdvanceOneKeyTimes, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeHolidayRetExpPercent:
                {
                    _cache.role.holidayRetExpPercent = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelClothes:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipFashion, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelWeapon:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipFashionWeapon, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelWing:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipWing, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelFootprint:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipFootPrint, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelBubble:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipBubble, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelSurround:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipSurround, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelWaistBelt:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipWaistBelt, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelElf:
                {
                    _cache.wardrobe.setFashionJewelInfo(EEquip._EEquipElf, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelInfoUpdate));
                    break;
                }
                case EEntityAttribute._EAttributeFashionJewelExp:
                {
                    _cache.wardrobe.setFashionJewelEachAttrCost(arg1.value, arg1.valueStr);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FashionJewelCostExpUpdage));
                    break;
                }
                case EEntityAttribute._EAttributePlayerMountMaxReinValue:
                {
                    _cache.role.mountMaxReinValue = arg1.value;
                    break;
                }
            }
            return;
        }

        /* internal  */copyProcessUpdate(arg1: SAttributeUpdate): void
        {
            var loc1=arg1.attribute.__value;
            switch (loc1) 
            {
                case EEntityAttribute._EAttributeCopyProcess:
                {
                    _cache.copy.process = arg1.value;
                    NetDispatcher.dispatchCmd(ServerCommand.Copy_ProcessUpdate, null);
                    break;
                }
            }
            return;
        }

        /* internal  */weaponUpdate(arg1: SAttributeUpdate): void
        {
            var loc1=null;
            var loc2=arg1.attribute.__value;
            switch (loc2) 
            {
                case EEntityAttribute._EAttributeWeapon:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeWeapon, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeHelmet:
                {
                    break;
                }
                case EEntityAttribute._EAttributeClothes:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeClothes, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeAmulet:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeAmulet, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeFootprint:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeFootprint, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeBubble:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeBubble, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeSurround:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeSurround, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeWaistBelt:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeWaistBelt, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeElf:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeElf, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeMounts:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeMounts, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeModel:
                {
                    _cache.role.entityInfo.modelId = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeNotShowFashion:
                {
                    _cache.role.isShowFashion = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowFashion, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeWing:
                {
                    _cache.role.addWeapon(EEntityAttribute._EAttributeWing, arg1.value);
                    break;
                }
                case EEntityAttribute._EAttributeNotShowWing:
                {
                    _cache.role.isShowWing = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowWing, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowFashionWeapon:
                {
                    _cache.role.isShowFashionWeapon = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowFashionWeapon, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowFootprint:
                {
                    _cache.role.isShowFootPrint = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowFootPrint, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowBubble:
                {
                    _cache.role.isShowBubble = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowBubble, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowSurround:
                {
                    _cache.role.isShowSurround = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowSurround, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowWaistBelt:
                {
                    _cache.role.isShowWaistBelt = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowWaistBelt, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeNotShowElf:
                {
                    _cache.role.isShowElf = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PlayerIsNotShowElf, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeTitleMain:
                {
                    loc1 = _cache.role.entityInfo;
                    if (loc1.titles == null) 
                    {
                        loc1.titles = new Map<any, any> /* flash.utils.Dictionary */();
                    }
                    loc1.titles[EEntityAttribute._EAttributeTitleMain] = arg1.valueStr;
                    break;
                }
                case EEntityAttribute._EAttributeTitleSecond:
                {
                    break;
                }
                case EEntityAttribute._EAttributeLifeStyleGoldHuntTime:
                {
                    _cache.petMing.goldJuTime = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetMingGoldJuTimeUpdate, _cache.petMing.goldJuTime));
                    break;
                }
            }
            return;
        }

        /* internal  */cdTimeUpdate(arg1: SAttributeUpdate): void
        {
            var loc1=arg1.attribute.__value;
            switch (loc1) 
            {
                case EEntityAttribute._EAttributeAttackCd:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSkillPublicCd:
                {
                    break;
                }
                case EEntityAttribute._EAttributeAttackCdDt:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSkillPublicCdDt:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSkillCd:
                {
                    break;
                }
            }
            return;
        }

        /* internal  */fightAttUpdate(arg1: SAttributeUpdate): void
        {
            var loc1=0;
            var loc2=0;
            var loc3=0;
            var loc4=arg1.attribute.__value;
            switch (loc4) 
            {
                case EEntityAttribute._EAttributeLife:
                {
                    if (RolePlayer.instance.isDead && arg1.value > 0) 
                    {
                        _cache.role.entityInfo.life = arg1.value;
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Role_Relived));
                    }
                    if (arg1.value <= 0) 
                    {
                        _cache.role.entityInfo.life = arg1.value;
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Role_Dead));
                    }
                    if (RolePlayer.instance.isRest) 
                    {
                        loc1 = arg1.value - _cache.role.entityInfo.life;
                        if (loc1 != 0) 
                        {
                            RolePlayer.instance.showAttributChange(new AttributeValue(AttributeTextType.currentLife, loc1 > 0, loc1 > 0 ? loc1 : -1 * loc1));
                        }
                    }
                    _cache.role.entityInfo.life = arg1.value;
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributeMana:
                {
                    if (RolePlayer.instance.isRest) 
                    {
                        loc1 = arg1.value - _cache.role.entityInfo.mana;
                        if (loc1 != 0) 
                        {
                            RolePlayer.instance.showAttributChange(new AttributeValue(AttributeTextType.currentMana, loc1 > 0, loc1 > 0 ? loc1 : -1 * loc1));
                        }
                    }
                    _cache.role.entityInfo.mana = arg1.value;
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributeSpeed:
                {
                    _cache.role.entityInfo.speed = arg1.value;
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributePhysicalAttack:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMagicAttack:
                {
                    break;
                }
                case EEntityAttribute._EAttributePower:
                {
                    break;
                }
                case EEntityAttribute._EAttributeAgile:
                {
                    break;
                }
                case EEntityAttribute._EAttributeHabitus:
                {
                    break;
                }
                case EEntityAttribute._EAttributeBrains:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSpiritual:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMaxLife:
                {
                    _cache.role.entityInfo.maxLife = arg1.value;
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributeMaxMana:
                {
                    _cache.role.entityInfo.maxMana = arg1.value;
                    this._isEntityInfoUpdate = true;
                    break;
                }
                case EEntityAttribute._EAttributePhysicalHurt:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMagicHurt:
                {
                    break;
                }
                case EEntityAttribute._EAttributePhysicalDefense:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMagicDefense:
                {
                    break;
                }
                case EEntityAttribute._EAttributePhysicalRelief:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMagicRelief:
                {
                    break;
                }
                case EEntityAttribute._EAttributeRelief:
                {
                    break;
                }
                case EEntityAttribute._EAttributeHit:
                {
                    break;
                }
                case EEntityAttribute._EAttributeJouk:
                {
                    break;
                }
                case EEntityAttribute._EAttributePass:
                {
                    break;
                }
                case EEntityAttribute._EAttributeBlock:
                {
                    break;
                }
                case EEntityAttribute._EAttributePhysicalCrit:
                {
                    break;
                }
                case EEntityAttribute._EAttributeMagicCrit:
                {
                    break;
                }
                case EEntityAttribute._EAttributeSpeededUp:
                {
                    break;
                }
                case EEntityAttribute._EAttributeToughness:
                {
                    break;
                }
                case EEntityAttribute._EAttributeAttackSpeed:
                {
                    break;
                }
                case EEntityAttribute._EAttributeAttackDistance:
                {
                    break;
                }
                case EEntityAttribute._EAttributeCombatCapabilities:
                {
                    loc2 = int(arg1.valueStr);
                    loc3 = int(_cache.role.combatCapabilities);
                    if (!(_cache.role.combatCapabilities == "--") && loc2 > loc3) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_Fighting, {"oldValue": loc3, "newValue": loc2}));
                    }
                    _cache.role.combatCapabilities = arg1.valueStr;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleFightCombatCapabilities, arg1.valueStr);
                    break;
                }
                case EEntityAttribute._EAttributeArenaMarkWeek:
                {
                    _cache.arena.arenaMarkWeek = arg1.value;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaMarkWeekChange, arg1.value));
                    break;
                }
                case EEntityAttribute._EAttributeFriendCanRemoveNum:
                {
                    _cache.friend.todayCanDeletefriendNum = arg1.value;
                    break;
                }
                case EEntityAttribute._EAttributeRuneFight:
                {
                    _cache.role.runeFight = arg1.valueStr;
                    NetDispatcher.dispatchCmd(ServerCommand.RoleFightRuneFight, arg1.valueStr);
                    break;
                }
            }
            return;
        }

        private /* var */_isEntityInfoUpdate: Boolean=false;

        private /* var */_code: int;
    }
